#include("../../comm/FormHead.html")
<div id="main">
    <form action="" class="layui-form margin-10" lay-filter="form">
        <input type="hidden" id="actions" name="actions" value="#(form.actions)">
        <input type="hidden" id="data_img1" name="data_img1" value="#(img.data_img1)">
        #(token??)

        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">ID</label>

                    <div class="layui-input-block">
                        <input type="text" readonly name="img_id"
                               placeholder="自动生成" value="#(img.img_id)" class="layui-input input-readonly">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">主键</label>

                    <div class="layui-input-block">
                        <input type="text" name="img_id" placeholder="请输入主键"
                               value="#(img.img_id)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">图片名</label>

                    <div class="layui-input-block">
                        <input type="text" name="img_name" placeholder="请输入图片名"
                               value="#(img.img_name)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">路经</label>

                    <div class="layui-input-block">
                        <input type="text" name="img_path" placeholder="请输入路经"
                               value="#(img.img_path)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">图片大小</label>

                    <div class="layui-input-block">
                        <input type="text" name="img_size" placeholder="请输入图片大小"
                               value="#(img.img_size)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">扩展名</label>

                    <div class="layui-input-block">
                        <input type="text" name="img_ext" placeholder="请输入扩展名"
                               value="#(img.img_ext)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">上传时间</label>

                    <div class="layui-input-block">
                        <input type="text" name="create_time" placeholder="请输入上传时间"
                               value="#(img.create_time)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">上传年份</label>

                    <div class="layui-input-block">
                        <input type="text" name="save_year" placeholder="请输入上传年份"
                               value="#(img.save_year)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">上传月份</label>

                    <div class="layui-input-block">
                        <input type="text" name="save_month" placeholder="请输入上传月份"
                               value="#(img.save_month)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">上专人ID</label>

                    <div class="layui-input-block">
                        <input type="text" name="update_user" placeholder="请输入上专人ID"
                               value="#(img.update_user)" class="layui-input">
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">图片示例</label>

                    <div class="layui-input-block">
                        <div class="layui-upload">
                            <img class="layui-upload-img" id="image1" src="" style="width:60px;height:60px">
                            <button type="button" class="layui-btn" style="vertical-align:bottom" id="imagebtn1">图1</button>
                            <img class="layui-upload-img" id="image2" src="" style="width:60px;height:60px">
                            <button type="button" class="layui-btn" style="vertical-align:bottom" id="imagebtn2">图2</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-row">
            <div class="layui-col-md12">
                <div class="layui-form-item">
                    <label class="layui-form-label">备注示例</label>

                    <div class="layui-input-block">
                        <textarea name="data_text" placeholder="请输入备注信息" class="layui-textarea" style="height:180px">#(img.data_text)</textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="Submit1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<SCRIPT LANGUAGE="JavaScript">
    <!--
    var $ = layui.$;
    layui.use('laydate', function () {
        layui.laydate.render({
            elem: '#not_time', type: 'datetime', format: 'yyyy-MM-dd HH:mm'
        });
    });
    //上传
    layui.use('upload', function () {
        layui.upload.render({
            elem: '#imagebtn1', url: 'UploadImages', size: 300, accept: 'image', exts: 'jpg|gif|png'
            , done: function (res) {
                if (res.code == 0) {
                    $('#image1').attr('src', res.object.view_path);
                    $('#data_img1').val(res.object.save_path);
                    return layer.msg('上传成功');
                } else {
                    return layer.msg('上传失败');
                }
            }
        });
    });
    layui.use(['form', 'myTool'], function () {
        var form = layui.form;
        form.on('submit(Submit1)', function (data) {
            layui.myTool.post("ModifySysImageApi", {postdata: JSON.stringify(data.field)}, function () {
                parent.layer.close(parent.index);
            });
            return false;
        });
    });
    //-->
</SCRIPT>
</body>
</html>